package com.jhgsys.internal.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jhgsys.internal.system.entity.TenantMenu;
import com.jhgsys.internal.system.mapper.TenantMenuMapper;
import com.jhgsys.internal.system.service.ITenantMenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @className TenantMenuServiceImpl
 * @description 
 * @author DingHaiTao
 * @date: 2024/7/18 10:34
*/
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class TenantMenuServiceImpl extends ServiceImpl<TenantMenuMapper, TenantMenu> implements ITenantMenuService {

    @Override
    @Transactional
    public void deleteTenantMenusByTenantId(List<String> tenantIds) {
        this.baseMapper.delete(new QueryWrapper<TenantMenu>().lambda().in(TenantMenu::getTenantId, tenantIds));
    }
}
